home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
n_b_v203.zip
/
GETATTR.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
66 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME GETATTR .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB02.INC"
COLOR 7, 0
CLS
? "┌──────────────────────────────────────────────────────────────────────
? "│ fGetAttrib? ( FileSpec$ )
? "├──────────────────────────────────────────────────────────────────────
? "│ Unlike PowerBASIC's FILEATTR, this function does NOT require that the
? "│ file in question be open, nor will it cause an error if the file is
? "│ not found! It simply returns a -1 if you attempt to send it trash or
? "│ if the file has been purloined!
? "│ The tests below may need some tweaking to get them all to work on
? "│ your system but its good practice d:)
? "│ RETURNS: -1 = file not found 0 = regular file
? "│ 1 = read only 8 = volume label
? "│ 2 = hidden 16 = directory
? "│ 4 = system 32 = archive file
? "└──────────────────────────────────────────────────────────────────────
? '┌─────────────────────────────────────────
Path$ = "DMO\" '│ pick a path
'│
F$ = Path$ + "NOTTHERE.XXX" '│ this file isn't there
PRINT F$; TAB(25); '│ returns a -1
PRINT fGetAttrib%( F$ ) '│
'│
F$ = Path$ + "GETATTR.DMO" '│ this file an archive file
PRINT F$; TAB(25); '│ returns a 32
PRINT fGetAttrib%( F$ ) '│
'│
F$ = "*.*" '│ wild cards don't work either
PRINT F$; TAB(25); '│ returns a -1
PRINT fGetAttrib%( F$ ) '│
'│
F$ = Path$ '│ just a path so
PRINT F$; TAB(25); '│ returns a 16
PRINT fGetAttrib%( F$ ) '│
'│
F$ = "C:\IBMBIO.COM" '│ this is a system, hidden and read only file
PRINT F$; TAB(25); '│ returns 7 ( 1, 2 and 4 )
PRINT fGetAttrib%( F$ ) '│
'│
F$ = "C:\" '│ another path
PRINT F$; TAB(25); '│ so, another 16
PRINT fGetAttrib%( F$ ) '│